using System.Collections.Generic;

namespace ThridGroup.ERP.DTO.SupplierDto
{
    /// <summary>
    /// 分页结果DTO
    /// </summary>
    /// <typeparam name="T">数据类型</typeparam>
    public class PagedResultDto<T>
    {
        /// <summary>
        /// 总记录数
        /// </summary>
        public long Count { get; set; }
        
        /// <summary>
        /// 数据列表
        /// </summary>
        public List<T> Data { get; set; }
        
        /// <summary>
        /// 状态码
        /// </summary>
        public int Code { get; set; } = 0;
        
        /// <summary>
        /// 消息
        /// </summary>
        public string Msg { get; set; } = "success";
        
        /// <summary>
        /// 构造函数
        /// </summary>
        public PagedResultDto()
        {
            Data = new List<T>();
        }
        
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="count">总数</param>
        /// <param name="data">数据</param>
        public PagedResultDto(long count, List<T> data)
        {
            Count = count;
            Data = data ?? new List<T>();
        }
    }
} 